package com.example.spring0909.section4.dao.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import com.example.spring0909.section4.dao.ProductDao;
import com.example.spring0909.section4.entity.Product;
@Repository
public class ProductDaoImpl implements ProductDao {

    @Autowired
    private JdbcTemplate template;

    @Override
    public int insert(Product product) {
        return template.update("insert into product values (?,?,?,?)"
                ,product.getPid(),product.getImg(),product.getName(),product.getDescription());
    }
}